package com.xxc.common.util

import org.springframework.core.io.ClassPathResource
import java.util.*


object ApplicationProps {

    val properties:Properties by lazy(ApplicationProps::class) {
        val prop = Properties()
        prop.load(ClassPathResource("application.properties").inputStream)
        prop
    }

    fun getProperties(name:String):String?{
        return properties.getProperty(name)
    }

    /**
     * 获取application.props中的属性
     */
    operator fun get(name:String):String?{
        return getProperties(name)
    }
}